package com.dyson.entity;

import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Author: Wy
 * @Email: DysonWy@foxMail.com
 * @Time: 2019/12/31 14:27
 * @Description:
 */

@Data
@Builder//builder 使用后需要加构造
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")//映射表名
public class User extends Model<User> {//继承Model AR模式
    private static final long serialVersionUID = -1974180216960523357L;
    @TableId//映射表主键
    private Long id;
    @TableField("name")//映射DB字段
    private String name;
    @TableField(condition = SqlCondition.NOT_EQUAL)//修改实体映射,等值方式
    private Integer age;
    private String email;
    private Long managerId;
    private LocalDateTime createTime;
    @TableField(exist = false)//非DB字段, 此为方式一。
    //private transient String remark; 方式二：transient 禁止序列化
    //private static String remark; 方式三：静态变量
    private String remark;
}
